/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

/**
 *
 * @author Fernando
 */
public class FactoryPrediction implements FactoryMethodPrediction {

    private double[] temperature;
    private double[] presion;
    private double[] pluviosity;

    public Graphic Draw(String graphic) {
        if (graphic.equals("Temp")) {
            temperature = new double[view.CentralFrame.registers.size()];
            for (int i = 0; i < view.CentralFrame.registers.size(); i++) {
                temperature[i] = (view.CentralFrame.registers.get(i).getTemperature());
            }
            return new PredictionTm(temperature);

        } else if (graphic.equals("Pluv")) {
            pluviosity = new double[view.CentralFrame.registers.size()];
            for (int i = 0; i < view.CentralFrame.registers.size(); i++) {
                pluviosity[i] = (view.CentralFrame.registers.get(i).getPluviosity());
            }
            return new PredictionPl(pluviosity);
        } else {
            presion = new double[view.CentralFrame.registers.size()];
            for (int i = 0; i < view.CentralFrame.registers.size(); i++) {
                presion[i] = (view.CentralFrame.registers.get(i).getAtmPressure());
            }
            return new PredictionAtm(presion);
        }
    }
}
